﻿<%@ Page Language="C#" MasterPageFile="~/Masters/AdminSchedule.master" AutoEventWireup="true"
 CodeFile="RouteEditStations.aspx.cs" Inherits="Pages_Carrier_RouteEditStations" Title="Редактирование промежуточных остановок" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphHead" Runat="Server">
	<link rel="stylesheet" type="text/css" media="screen" href="../../styles/EntityViewStyle.css" />
	<link rel="stylesheet" type="text/css" media="screen" href="../../styles/EntityEditStyle.css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphContent" Runat="Server">
	<a href="" runat="server" id="aReturnToRoute">Вернуться к редактированию маршрута</a>
	<p>
		<asp:Label runat="server" ID="lbMessage" />
	</p>
	<p>
		<b><asp:Label runat="server" ID="lbRouteName" /></b>
	</p>
	<asp:Repeater runat="server" ID="rpt1">
		<HeaderTemplate>
			<asp:ValidationSummary runat="server" ID="vs1" CssClass="miniTableView" ValidationGroup="vgSave" DisplayMode="List"
									 BorderColor="Red" BorderStyle="Solid" HeaderText="Обнаружены ошибки:" />
			<table class="miniTableView">
				<tr>
					<th>Остановка</th>
					<th>Расстояние (км)</th>
					<th>Время в пути (ч)</th>
					<th>Место посадки</th>
				</tr>
		</HeaderTemplate>
		<ItemTemplate>
				<tr>
					<td><%# Eval("station.Name")%>
						<asp:HiddenField runat="server" ID="hfRouteStationM2MId" Value='<%# Eval("Id") %>' />
					</td>
					<td>
						<asp:TextBox runat="server" ID="tbDistance" Text='<%# Eval("Distance")%>' Width="70px" />
						<asp:RangeValidator Type="Double" runat="server" ID="rvDistance" ControlToValidate="tbDistance"
											MinimumValue="0" MaximumValue="10000"
											Text="*" ErrorMessage="Расстояние должно быть числом" ValidationGroup="vgSave" />
					</td>
					<td>
						<asp:TextBox runat="server" ID="tbTimeDistance" Text='<%# Eval("TimeDistance")%>' Width="70px" />
						<asp:RangeValidator Type="Double" runat="server" ID="rvTimeDistance" ControlToValidate="tbTimeDistance"
											MinimumValue="0" MaximumValue="10000"
											Text="*" ErrorMessage="Время в пути должно быть числом" ValidationGroup="vgSave" />
					</td>
					<td>
						<asp:TextBox runat="server" ID="tbLandingPlace" Text='<%# Eval("LandingPlace") %>' Width="200px" />
					</td>
				</tr>
		</ItemTemplate>
		<FooterTemplate>
			</table>
		</FooterTemplate>
	</asp:Repeater>
	<div class="buttons">
		<asp:Button runat="server" ID="btnSave" Text="Сохранить" ValidationGroup="vgSave" OnClick="OnRouteStationsSave" />
		<asp:Button runat="server" ID="btnCancel" Text="Отменить" OnClick="OnCancel" />
	</div>
</asp:Content>

